Skip to content

Comments

ethereum: Handle mixed block formats in recent_blocks_cache#6312

Merged
incrypto32 merged 1 commit intomasterfrom
krishna/recent-blocks-cache-fix
Jan 30, 2026
Merged

ethereum: Handle mixed block formats in recent_blocks_cache#6312
incrypto32 merged 1 commit intomasterfrom
krishna/recent-blocks-cache-fix

Conversation

@incrypto32
Copy link
Member

@incrypto32 incrypto32 commented Jan 29, 2026

The recent_blocks_cache can contain blocks in two formats:

  • Full format: {"block": {...}, "transaction_receipts": [...]}
  • Light format: just block fields (no wrapper)

This happens because different code paths populate the cache with
different formats (upsert_block uses full, blocks_from_store uses light).

  The recent_blocks_cache can contain blocks in two formats:
  - Full format: {"block": {...}, "transaction_receipts": [...]}
  - Light format: just block fields (no wrapper)

  This happens because different code paths populate the cache with
  different formats (upsert_block uses full, blocks_from_store uses light).

  Changes:
  - load_blocks/parent_ptr: Extract block data from full format if needed
    using `value.get("block").unwrap_or(&value)`
  - ancestor_block: Explicit check for light format with clear logging,
    falls back to Firehose/RPC since receipts are needed for triggers
  - Improved log messages to show block number and hash on failures
@incrypto32 incrypto32 merged commit b394328 into master Jan 30, 2026
6 checks passed
@incrypto32 incrypto32 deleted the krishna/recent-blocks-cache-fix branch January 30, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants